<template>
  <div class="background">
    <a-tabs default-active-key="1" size="large" @change="tabsChange">
      <a-tab-pane v-for="(item, index) in tabOption" :key="item.key_value" :tab="item.key_name">
        <component ref="childComponentRef" :is="item.component" />
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script>
import QingHua from './QingHua.vue'
import ShuMian from './ShuMian.vue'
import BingTiao from './BingTiao.vue'
import CuSha from './CuSha.vue'
import TuiCuSha from './TuiCuSha.vue'
import QingHuaPinZhongGongDingCanShu from './QingHuaPinZhongGongDingCanShu.vue'
import ShuMianPinZhongGongDingCanShu from './ShuMianPinZhongGongDingCanShu.vue'
import BingTiaoPinZhongGongDingCanShu from './BingTiaoPinZhongGongDingCanShu.vue'
import CuShaPinZhongGongDingCanShu from './CuShaPinZhongGongDingCanShu.vue'
import XinCuSha from './XinCuSha.vue'
import XinBingTiao from './XinBingTiao.vue'
// import Luotong from './Luotong.vue'
// import Luotong from './Luotong.vue'
// import Dabao from './Dabao.vue'
export default {
  components: {
    QingHua,
    ShuMian,
    BingTiao,
    CuSha,
    TuiCuSha,
    QingHuaPinZhongGongDingCanShu,
    ShuMianPinZhongGongDingCanShu,
    BingTiaoPinZhongGongDingCanShu,
    CuShaPinZhongGongDingCanShu,
    XinCuSha,
    XinBingTiao,

  },
  data() {
    return {
      tabOption: [
        {key_value: '1', key_name: '清花', component: 'QingHua'},
        {key_value: '2', key_name: '梳棉', component: 'ShuMian'},
        {key_value: '3', key_name: '并条', component: 'BingTiao'},
        {key_value: '4', key_name: '粗纱', component: 'CuSha'},
        {key_value: '5', key_name: '清花品种共定参数', component: 'QingHuaPinZhongGongDingCanShu'},
        {key_value: '6', key_name: '梳棉品种共定参数', component: 'ShuMianPinZhongGongDingCanShu'},
        {key_value: '7', key_name: '并条品种共定参数', component: 'BingTiaoPinZhongGongDingCanShu'},
        {key_value: '8', key_name: '粗砂品种共定参数', component: 'CuShaPinZhongGongDingCanShu'},
        // {key_value: '9', key_name: '新粗砂', component: 'XinCuSha'},
        // { key_value: '10', key_name: '新并条', component: 'XinBingTiao' },
        // { key_value: '8', key_name: '打包', component: 'Dabao' },
        { key_value: '9', key_name: '推粗纱', component: 'TuiCuSha' },
      ],
      importVisible: false
    }
  },
  mounted() {
  },
  methods: {
    tabsChange(){
      // 获取对子组件的引用
      const childComponent = this.$refs.childComponentRef;
      childComponent.forEach((item) => {
        item.searchQuery()
      })
    }
  }
}
</script>

<style>
.background {
  padding: 0 15px;
  background-color: white;
  border-radius: 5px;
  box-shadow: 1px 4px 4px rgba(0, 0, 0, 0.05);
}
</style>
